<template>
  <el-dialog title="社群详情" v-model="visible" width="850px" @close="onClose">
    <div class="main">
      <slot name="defult"></slot>
    </div>
    <template #footer v-if="showButton">
      <el-button @click="handleAction(false)">取消</el-button>
      <el-button :loading="submit" type="primary" @click="handleAction(true)"> 导出 </el-button>
    </template>
  </el-dialog>
</template>

<script setup>
const props = defineProps({
  visible: {
    type: Boolean,
    default: false
  },
  showButton: {
    type: Boolean,
    default: true
  }
})

const emit = defineEmits(['update:visible'])

const visible = computed({
  get() {
    return props.visible
  },
  set(value) {
    emit('update:visible', value)
  }
})

function handleAction(confirm) {
  if (confirm) {
    emit('handleAction', confirm)
  } else {
    emit('handleAction', confirm)
  }
}
</script>

<style lang="scss" scoped></style>
